package com.egao.common.core.utils;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.egao.common.system.entity.UserTwo;
import com.egao.common.system.mapper.UserTwoMapper;
import org.springframework.beans.factory.annotation.Autowired;

import javax.annotation.Resource;
import java.util.Arrays;
import java.util.List;

/**
 * author: zhaopeng wang
 * date: 2022-03-13 11:39
 * description: UserUtil
 */
public class UserUtil {

    public Integer getUserId(Object o){
        StringBuffer stringBuffer = new StringBuffer();
        stringBuffer.append(o);
        String s = stringBuffer.toString();
        List<String> strings = Arrays.asList(s.split(", "));
        String s1 = strings.get(1);

        char[] chars = s1.toCharArray();
        StringBuffer res = new StringBuffer();
        for(char a : chars){
            if (Character.isDigit(a)){
                res.append(a);
            }
        }



        return Integer.valueOf(res.toString());
    }
}
